home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20031118-20041115
/
000401_fdc@columbia.edu_Wed Sep 22 13:33:01 2004.msg
< prev
next >
Wrap
Internet Message Format
|
2004-11-14
|
3KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Return codes and If statments
Date: 22 Sep 2004 17:32:18 GMT
Organization: Columbia University
Lines: 55
Message-ID: <slrncl3dp2.ftp.fdc@sesame.cc.columbia.edu>
References: <3f9c05b0.0409211252.5aa51cb1@posting.google.com> <slrncl18i5.56s.fdc@sesame.cc.columbia.edu> <1095827419.338981.28270@k26g2000oda.googlegroups.com> <3f9c05b0.0409220853.25e5bd46@posting.google.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1095874338 3737 128.59.59.56 (22 Sep 2004 17:32:18 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 22 Sep 2004 17:32:18 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15179
On 2004-09-22, Peter V. <dm_v_2000@yahoo.com> wrote:
: thank you both for your advice. I am sticking to recommended format
: Number 2, and that seems to have done the trick.
:
I realize it might be a big counterintuitive for C programmers, but it
should be recalled that Kermit differs from C not only in being interpretive
rather than compiled, but also it's an interactive command language, and
therefore necessarily line-oriented: each command is one line. Thus the
true format of a compound IF-ELSE statement is:
if <condition> { command, command, ... } ELSE { command, command, ... }
Prior to C-Kermit 7.0, if you wanted to break such a statement onto multiple
lines, you had to use line continuation:
if <condition> { -
command, -
command, -
... -
} ELSE {
command, -
command, -
... -
}
Version 7.0 added several tricks to the parser to give more natural
syntax: (a) If a line ENDS with "{" (ignoring whitespace) it is continued
and begins a block; (b) if a line BEGINS with "}" (ignoring whitespace) it
ends a block; (c) if a block is active, the end of each line implies a
comma (which is used to separate statements within blocks). Once a block
is opened at top level, these tricks are used until the block is closed,
and naturally, they persist through any level of nesting. This explains
why a construction like:
IF <condition> {
command
command
}
works, but:
IF <condition>
{
command
command
}
doesn't. The first line is an incomplete command with no indication of
continuation. The documentation:
http://www.columbia.edu/kermit/ckermit70.html#x7.20
does not list the latter form as a possibility.
- Frank